package com.heima.model.search.dtos;

import com.heima.model.article.pojos.ApArticle;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class SearchArticleVo {

    // 文章id
    private Long id;
    // 文章标题
    private String title;
    // 文章发布时间
    private Date publishTime;
    // 文章布局
    private Integer layout;
    // 封面
    private String images;
    // 作者id
    private Long authorId;
    // 作者名词
    private String authorName;
    //静态url
    private String staticUrl;
    //文章内容
    private String content;
    //建议
    private String suggestion;

    private String h_title;

    public SearchArticleVo(ApArticle apArticle) {
        this.id = apArticle.getId();
        this.title = apArticle.getTitle();
        this.authorId = apArticle.getAuthorId();
        this.authorName = apArticle.getAuthorName();
        this.layout = Integer.valueOf(apArticle.getLayout());
        this.images = apArticle.getImages();
        this.publishTime = apArticle.getPublishTime();
        this.staticUrl = apArticle.getStaticUrl();
    }

}